package com.rd.sys.dto.commmon.enums;

import java.util.HashMap;
import java.util.Map;

import baseproj.common.constants.BaseEnum;
import baseproj.inter.Message;

public class SysCfgEnum {

    /**
     * 系统参数类型枚举.
     */
    public enum ParamType implements BaseEnum {

        /** 处理机. */
        type1("1", Message.getMessage("sys.syscfg.processor")),

        /** 门户. */
        type2("2", Message.getMessage("sys.syscfg.webportals"));

        /** The code. */
        private final String code;

        /** The name. */
        private final String name;

        /** The code map. */
        public static Map<String, String> codeMap = new HashMap<String, String>();

        /**
         * Instantiates a new param type.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        ParamType(String code, String name) {
            this.code = code;
            this.name = name;
        }

        static {
            for (int i = 0; i < values().length; i++) {
                codeMap.put(values()[i].code, values()[i].name);
            }
        }

        /**
         * Equals.
         * 
         * @param value
         *            the value
         * @return true, if successful
         * @version
         */
        public boolean equals(String value) {
            return this.code.equals(value);
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        @Override
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        @Override
        public String getName() {
            return name;
        }
    }

    /**
     * 参数值类型.
     */
    public enum Type implements BaseEnum {

        /** The Number. */
        Number("0", Message.getMessage("sys.syscfg.valuetype.number")),

        /** The String. */
        String("1", Message.getMessage("sys.syscfg.valuetype.string"));

        /** The code. */
        private final String code;

        /** The name. */
        private final String name;

        /** The code map. */
        public static Map<String, String> codeMap = new HashMap<String, String>();

        /**
         * Instantiates a new type.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        Type(String code, String name) {
            this.code = code;
            this.name = name;
        }

        static {
            for (int i = 0; i < values().length; i++) {
                codeMap.put(values()[i].code, values()[i].name);
            }
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        @Override
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        @Override
        public String getName() {
            return name;
        }

    }

    /**
     * 是否可修改标志:1可编辑2只读3不可见.
     */
    public enum ParamFlag implements BaseEnum {

        /** The Edit. */
        Edit("1", "Edit"),
        /** The Read only. */
        ReadOnly("2", "ReadOnly"),
        /** The Disable. */
        Disable("3", "Disable");

        /** The code. */
        private final String code;

        /** The name. */
        private final String name;

        /** The code map. */
        public static Map<String, String> codeMap = new HashMap<String, String>();

        /**
         * Instantiates a new param flag.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        ParamFlag(String code, String name) {
            this.code = code;
            this.name = name;
        }

        static {
            for (int i = 0; i < values().length; i++) {
                codeMap.put(values()[i].code, values()[i].name);
            }
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        @Override
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        @Override
        public String getName() {
            return name;
        }

    }
}
